<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../../../css/style.css" />
		<link rel="stylesheet" href="../../../javascript/plug-ins/layui/css/layui.css" media="all" />		
		<script src="../../../javascript/jquery.js"></script>
		<script type="text/javascript" src="../../../javascript/plug-ins/pagination.js" ></script>
		<script src="../../../javascript/laydate/laydate.js"></script>
		<script type="text/javascript" src="../../../javascript/plug-ins/layui/layui.js"></script>	

		<script src="js/add_kanjia.js"></script>	
   <!--<script src="../../../javascript/editor/ueditor.config.js"></script>
        <script src="../../../javascript/editor/ueditor.all.js"></script>-->
		
	</head>
	<body>
		
	   <div class="page-wrap">		
		
		<section class="page-hd t">         
         <header>
			<h5 class="title">
				<a href="#" class="red">新增砍价商品</a>
			</h5>	
		 </header>
		 <hr>
		</section>
		
		<div class="panel panel-default">
		 
		 <div class="form-content">
		 	
		 	<form>
		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">商品名称：</div>
		 			<div class="form-cont">
		 				<input type="text" id="goods_name" class="form-control form-boxed width30" placeholder="请输入商品名称"/>
		 			</div>
		 		</div>
		 		<div class="form-group-col-2">
		 			<div class="form-label">权重：</div>
		 			<div class="form-cont">
		 				<input type="text" id="quanzh" class="form-control form-boxed width30" placeholder="请设置权重"/>
						<span class="word-aux" style="color:red">(权重最大为4位整数,权重越大越靠前)</span>
		 			</div>
		 		</div>
				
				<div class="form-group-col-2">
		 			<div class="form-label">用户类型：</div>
		 			<label class="check-box"><input type="checkbox" onclick="check1()" id="usertype" name="r" value="-1"/><span>全选</span></label>
		 			<div class="form-cont">
		 			<ul id="type">
		                <li style="float:left;"><label class="check-box"><input type="checkbox" name="r" value="0"/><span>新用户</span></label></li>
		 				<li style="float:left;"><label class="check-box"><input type="checkbox" name="r" value="1"/><span>老用户</span></label></li>
		 				<li style="float:left;"><label class="check-box"><input type="checkbox" name="r" value="2"/><span>VIP用户</span></label></li>
					<!--	<li style="float:left;"><label class="check-box"><input type="checkbox" name="r" value="3"/><span>VIP首充</span></label></li> -->
		 			</ul>
		 			</div>
		 		</div>
				
				
		 		<div class="form-group-col-2">
		 			<div class="form-label">商品标签价格：</div>
		 			<div class="form-cont">
		 				<input type="text" id="Price_sign" class="form-control form-boxed width30" placeholder="请输入商品标签价格"/>
		 			</div>
		 		</div>
		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">设置底价：</div>
		 			<div class="form-cont">
		 				<input type="text" id="Floor_price" class="form-control form-boxed width30" placeholder="请设置底价"/>
		 			</div>
		 		</div>
		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">显示底价：</div>
		 			<div class="form-cont">
		 				<label class="radio-box"><input type="radio" name="isshow_dj" value="1"/><span>显示</span></label>
		 				<label class="radio-box"><input type="radio" name="isshow_dj" value="0"/><span>不显示</span></label>
		 			</div>
		 		</div>
		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">没砍到低价：</div>
		 			<div class="form-cont">
		 				<label class="radio-box"><input type="radio" name="no_dj" value="1"/><span>可以下单</span></label>
		 				<label class="radio-box"><input type="radio" name="no_dj" value="0"/><span>不可以下单</span></label>
		 			</div>
		 		</div>
		 				 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">自己砍价：</div>
		 			<div class="form-cont">
		 				<label class="radio-box"><input type="radio" name="kj_bargain" value="1"/><span>可以</span></label>
		 				<label class="radio-box"><input type="radio" name="kj_bargain" value="0"/><span>禁止</span></label>
		 			</div>
		 		</div>
		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">发起次数：</div>
		 			<div class="form-cont" onclick="fqcs()">
		 				<label class="radio-box"><input type="radio" name="Launch_Number" value="1"/><span>每个商品只允许发起一次砍价 </span></label>
		 				<label class="radio-box"><input type="radio" name="Launch_Number" value="0"/><span>允许多次发起同一个商品的砍价</span></label>
		 			</div>
		 		</div>
				<div class="form-group-col-2" id="is_fq" style="display:none;">
		 			<div class="form-label">活动可发起次数：</div>
		 			<div class="form-cont">
		 				<input type="text" id="all_number" class="form-control form-boxed width30" placeholder=""/>次
		 			</div>
		 		</div>
		 				 
		 		<div class="form-group-col-2">
		 			<div class="form-label">商品库存：</div>
		 			<div class="form-cont">
		 				<input type="text" id="goods_kucun" class="form-control form-boxed width30" placeholder="请输入商品库存"/>
		 			</div>
		 		</div>	

				<div class="form-group-col-2" id="prize_picture">
		 			<div class="form-label">商品图片：</div>
		 			<div class="form-cont">
		                <input class="btn btn-warning" value="请上传图片" type="button" id="uploadimgs"/>
		                <span class="word-aux">图片像素为630*542，图片不大于150kb</span>
		 			</div>
		 		</div>
				<div class="form-group-col-2" id="Prize_img" style="display:none">
		 			<div class="form-label"></div>
		 			<div class="form-cont">
						<img id="preview" src="#" height="100" />
						<p id="demoText"></p>
		                <!--  <img src="../../../img/user-img0.jpg" height="100" />		-->
		 			</div>
		 		</div>
				
		 		<div class="form-group-col-2">
		 			<div class="form-label">活动时间：</div>
		 			<div class="form-cont">
						<input onclick="laydate()" id="stardate" class="form-control laydate-icon width20" type="text" value="" placeholder="开始时间" />-
		                <input onclick="laydate()" id="enddate" class="form-control laydate-icon width20" type="text" value="" placeholder="结束时间" />
		             
		 			</div>
		 		</div>
		 				 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">砍价时限：</div>
		 			<div class="form-cont">
		 				<input type="text" id="Cut_time" class="form-control form-boxed width30" placeholder=""/>小时
						<span class="word-aux" style="color:red">(时限不得超过24小时)</span>
		 			</div>
		 		</div>
		 				 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">可砍价总次数：</div>
		 			<div class="form-cont">
		 				<input type="text" id="cut_number" class="form-control form-boxed width30" placeholder=""/>次
		 			</div>
		 		</div>
		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">每人可砍次数：</div>
		 			<div class="form-cont">
		 				<input type="text" id="each_number" class="form-control form-boxed width30" placeholder=""/>次
		 			</div>
		 		</div>
		 		 		 		 		
		 		 <div class="form-group-col-2">
		 			<div class="form-label">每次砍价概率：</div>
		 			<div class="form-cont qujianlist">
					  <span class="word-aux" style="color:red">(最大增加金额用正数表示，例如：6 ， 最大减少金额用负数表示，例如：-6 ，概率相加必须等于100%)</span>
		 			  <p class="margin_buttom10 qujianitem">
						<input type="text" class="form-control form-boxed width20 min_yuan" placeholder=""/>元至
						<input type="text" class="form-control form-boxed width20 max_yuan" placeholder=""/>元，
						概率<input type="text" class="form-control form-boxed width20 probability" placeholder=""/>%  						
					  </p>
		 			  <p class="margin_buttom10"><input id="addqujian" class="btn btn-info" type="button" value="添加区间" /> 
					    <input id="removequjian" class="btn btn-primary" type="button" value="删除区间" /> 
					  </p>
		 			  
		 			</div>
		 		</div>
		 				 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">【分享】商品标题</div>
		 			<div class="form-cont">
		 				<input type="text" id="fenx_biaoti" class="form-control form-boxed width30" placeholder=""/>
		 			</div>
		 		</div>
		             
		        <div class="form-group-col-2">
		 			<div class="form-label">【分享】商品描述</div>
		 			<div class="form-cont">
		 				<input type="text" id="fenx_miaosu" class="form-control form-boxed width70" placeholder=""/>
		 			</div>
		 		</div>     
		 		
		        <div class="form-group-col-2" id="kanj_picture">
		 			<div class="form-label">【分享】砍价图片</div>
		 			<div class="form-cont">
		                <input class="btn btn-warning" value="请上传图片" type="button" id="uploadimgs2"/>
		                <span class="word-aux">图片像素为630*542，图片不大于150kb</span>
		 			</div>
		 		</div>
		 		
		 		<div class="form-group-col-2" id="kanj_img" style="display:none">
		 			<div class="form-label"></div>
		 			<div class="form-cont">
		                 <img id="preview2" src="#" height="100" />
						 <p id="demoText2"></p>
		 			</div>
		 		</div> 
		        <div class="form-group-col-2" style="display:none;">
		 			<div class="form-label">【分享】砍价标题</div>
		 			<div class="form-cont">
					<select class="width20" id="kj_biaoti" readonly="true;">
						<option value="-1" selected="selected">请选择砍价标题</option>
						<option value="1">原价</option>
						<option value="2">现价</option>
						<option value="3">底价</option> 
						<option value="4">已砍</option>
						<option value="5">未砍</option>
					</select>
		 			<!--	<input type="text" class="form-control form-boxed width30" placeholder="" value="" />
		 				 <span class="word-aux">砍价标题模板标签: [原价] [现价] [底价] [已砍] [未砍]</span>
						 -->
		 			</div>
		 		</div>   
		 				 		
		 		<div class="form-group-col-2" style="display:none;">
		 			<div class="form-label">【分享】砍价描述</div>
		 			<div class="form-cont">
		 				<input type="text" id="kj_miaosu" class="form-control form-boxed width70" placeholder=""/>
		 		    </div>
		 		</div>    
		 		
		 		 
		 				 		
		 	<!--	<div class="form-group-col-2">
		 			<div class="form-label">砍价规则：</div>
		 			<div class="form-cont">
		 				<label class="check-box"><input id="roed" type="checkbox"/><span>使用全局规则 </span></label>
		 			</div>
		 		</div>
		 		-->
		 		<div class="form-group-col-2" id="roedhide">
		 			<div class="form-label">砍价规则设置：</div>
		 			<div class="form-cont">
					<textarea class="form-control form-boxed width70" id="kj_rule"></textarea >
		 			<!--	<script id="container" class="width80" name="content" type="text/plain">ss</script>
					    <script type="text/javascript">
							var ue = UE.getEditor('container');
							ue.setContent("ddddd");
							
							alert(ue.getContent());
							
						</script> 
						-->
		 			</div>
		 		</div>
		 		
		 			     
		 		<div class="form-group-col-2" style="display:none;">
		 			<div class="form-label">倒计时前的文字：</div>
		 			<div class="form-cont">
		              <input class="form-control width50" id="djs_words" type="text" placeholder="请输入倒计时前的文字" />
		 			</div>
		 		</div>
		 		
		 		<div class="form-group-col-2" style="display:none;">
		 			<div class="form-label">砍多少减多少文字</div>
		 			<div class="form-cont">
		              <input class="form-control width50" id="cut_words" type="text" placeholder="请输入砍多少减多少文字" />
		 			</div>
		 		</div>
		 		
<!--		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">砍价按钮颜色：</div>
		 			<div class="form-cont">
		              <input class="form-control width50" type="text" value="" placeholder="请输入砍价按钮颜色" />
		 			</div>
		 		</div>-->
		 		 		
				<div class="form-group-col-2" id="Twocode">
		 			<div class="form-label">二维码：</div>
		 			<div class="form-cont" id="aa">
		                <input class="btn btn-warning" value="点击生成二维码" type="button" onclick="up_Twocode()" />		               
		 			</div>
		 		</div>	
				
				<div class="form-group-col-2" id="show_twocode" style="display:none">
		 			<div class="form-label"></div>
		 			<div class="form-cont">
		                 <img id="preview3" src="#" height="100" />
						 <p id="demoText3"></p>
		 			</div>
		 		</div> 				
						
				<div class="form-group-col-2" id="fx_lj">
		 			<div class="form-label">【分享】连接：</div>
		 			<div class="form-cont">
		                <input class="btn btn-warning" value="点击生成分享连接" type="button" id="hook_up" onclick="get_fxlj()"/>
		                <input class="form-control width50" style="display:none;" id="lj_nr" type="text" readonly="true;"/>
		 			</div>
		 		</div>		
				
				
				
						
						
						
		 		<div class="form-group-col-2">
		 			<div class="form-label"></div>
		 			<div class="form-cont">
                       <input type="button" value="提交" onclick="add_kanjia()" class="btn btn-info" />
					   <input type="button" value="返回" onclick="re()" class="btn btn-danger" />
		 			</div>
		 		</div>
		 		
		 		
		 	</form>
		 	
		 	
		 </div><!--form--->
		
		
		</div><!---panel--->
			
	   </div><!---page-wrap------>		
		
		
	</body>


	<script>
		
	/*	$("#roed").change(function(){
			
			$("#roedhide").toggle();
			
		});
		
		*/
		$("#addqujian").click(function(){
			$("#addqujian").before('<p class="margin_buttom10 qujianitem"><input type="text" class="form-control form-boxed width20 min_yuan" placeholder="" value="" />元至 <input type="text" class="form-control form-boxed width20 max_yuan" placeholder="" value="" />元，概率<input type="text" class="form-control form-boxed width20 probability" placeholder="" value="" />%   </p>');
		});
		
		$("#removequjian").click(function(){
			var lens = $(".qujianitem").length;
			if(lens==1){
				layer.alert("至少保留一个砍价概率");
			}else{
				$(".qujianlist .qujianitem").last().remove();
			}	
			
			 
	    });			
		
	</script>
	
</html>
